package com.yuandian.api.management.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yuandian.api.management.validate.UpdateFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 指标信息-实体
 * @author zfsn
 * @date 2023-4-4
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "指标信息", description = "")
@TableName("conf_alarm_indicators")
public class ConfAlarmIndicators extends BasePage<ConfAlarmIndicators> {

	/**
	 *
	 */
	@ApiModelProperty(value = "指标编号", notes = "")
	@NotNull(message = "指标编号不能为空", groups = {UpdateFlag.class})
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 * 1-基础告警2-自定义告警3-访问量基线告警
	 */
	@ApiModelProperty(value = "指标类型", notes = "1-基础告警2-自定义告警3-访问量基线告警")
	private Integer type;

	/**
	 *
	 */
	@ApiModelProperty(value = "指标名称", notes = "")
	private String name;

	/**
	 * 当type=1, 基础告警时必填
	 */
	@ApiModelProperty(value = "指标编码", notes = "当type=1, 基础告警时必填")
	private Integer code;

	/**
	 * 1代表数字类型，2代表字符类型
	 */
	@ApiModelProperty(value = "指标值类型", notes = "1代表数字类型，2代表字符类型")
	private String valueType;

	/**
	 *
	 */
	@ApiModelProperty(value = "指标单位", notes = "")
	private Integer unit;

	/**
	 * 当type=2时必填， 对应name 在字典表中
	 */
	@ApiModelProperty(value = "指标对象", notes = "当type=2时必填， 对应name 在字典表中")
	private Integer objId;

	/**
	 * 当type=2时必填
	 */
	@ApiModelProperty(value = "表达式", notes = "当type=2时必填")
	private String expression;

	/**
	 * 0-启用 1-禁用
	 */
	@ApiModelProperty(value = "启用状态", notes = "0-启用 1-禁用")
	private Integer isEnable;

	/**
	 *
	 */
	@ApiModelProperty(value = "指标说明", notes = "")
	private String description;

	/**
	 *
	 */
	@ApiModelProperty(value = "创建人", notes = "")
	private String createBy;

	/**
	 *
	 */
	@ApiModelProperty(value = "创建时间", notes = "")
	private LocalDateTime createTime;

	/**
	 *
	 */
	@ApiModelProperty(value = "更新人", notes = "")
	private String updateBy;

	/**
	 *
	 */
	@ApiModelProperty(value = "更新时间", notes = "")
	private LocalDateTime updateTime;

	/**
	 * 是否逻辑删除，0：否、1：是
	 */
	@ApiModelProperty(value = "是否逻辑删除", notes = "是否逻辑删除，0：否、1：是")
	private Integer isDel;

	/**
	 *
	 */
	@ApiModelProperty(value = "备注", notes = "")
	private String remarks;

	/**
	 * 当type=2，告警类型为自定义告警时必填，来自字典表
	 */
	@ApiModelProperty(value = "颗粒度", notes = "当type=2，告警类型为自定义告警时必填，来自字典表")
	private Integer particleId;

	/**
	 * 基础告警指标页面使用，BPM或者NPM
	 */
	@ApiModelProperty(value = "所属类型", notes = "基础告警指标页面使用，BPM或者NPM")
	private String category;

	/**
	 *	指标对象
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "指标对象", notes = "")
	private String indicatorsObject;

	/**
	 *	颗粒度名称
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "颗粒度名称", notes = "")
	private String particleName;


	/**
	 * 告警配置集合
	 */
	@TableField(exist = false)
	private List<ConfAlarm> alarmConfigList;

	/**
	 * 统计颗粒度枚举
	 */
	@TableField(exist = false)
	private AlarmEnum.ParticleEnum particleEnum;

	/**
	 * 指标对象枚举
	 */
	@TableField(exist = false)
	private AlarmEnum.IndicatorObjEnum indicatorObjEnum;
	/**
	 *	指标单位
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "指标单位", notes = "")
	private String unitName;

	/**
	 *	告警对象
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警对象", notes = "")
	private String objName;

	/**
	 * 指标编码
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "指标编码", notes = "")
	private String codeName;

}
